﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace IRC.Utilities.Entities
{
    public class NodeConfiguration
    {
        public int NodeID { get; set; }

        public string Hostname { get; set; }

        public int RoutingPort { get; set; }

        public int LocalPort { get; set; }

        public int ServerPort { get; set; }

        /// <summary>
        /// Gets the node end point.
        /// </summary>
        /// <param name="node">The node.</param>
        /// <returns>Node's IPEndpoint</returns>
        public IPEndPoint GetNodeEndPoint()
        {
            IPAddress ipAddress = ConfigFileParser.DNSLookup(this.Hostname);
            IPEndPoint ipEndpoint = new IPEndPoint(ipAddress, this.RoutingPort);
            return ipEndpoint;
        }
    }
}
